Ternary 三元運算子


Posted by Rich on 2021-04-22

console.log(10 > 5 ? 'bigger' : 'smaller')
output:bigger

condition ? true : false
條件 ? true就執行 : false就執行


#note







Related Posts

簡明 App Inventor 手機應用程式設計入門教學

簡明 App Inventor 手機應用程式設計入門教學

[FE302] React 基礎 - hooks 版本:再戰 todo list 與其他 hooks

[FE302] React 基礎 - hooks 版本:再戰 todo list 與其他 hooks

Golang中的字元

Golang中的字元


Comments